{include file="pub_header.htm"}
<div class="out_table">
<table width="100%" cellpadding="6" cellspacing="6" border="0" align="center" class="frame_table">
  <tr>
    <td width="20%" align="center" valign="top" bgcolor="#EEEEEE">
      {include file="pub_submenu.htm"}
    </td>
    <td width="80%" align="center" valign="top" bgcolor="#FFFFFF">

      {if $get.ope == "add"}
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
        <tr>
          <td align="left" nowrap>&nbsp;
            <a href="{$control_admin}" target="_self" class="current_place">管理首页</a>
            &raquo; <a href="{$control_admin}?act=member_group" target="_self" class="current_place">会员群组设定</a>
            &raquo; <a href="{$control_admin}?act=member_group&ope=add&pag={$get.pag}" target="_self" class="current_place">添加会员群组</a>
          </td>
          <td align="right" nowrap>
            [
            <a href="{$control_admin}?act=member_group&pag={$get.pag}" target="_self" class="current_place">会员群组列表</a>
            ]
          </td>
        </tr>
      </table>
      </div>

      <div class="space"></div>
      <div class="right_table">
      <form id="member_group_add" name="member_group_add" method="post" action="javascript:void(null);" enctype="multipart/form-data">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td colspan="3">添加会员群组</td>
        </tr>
        <tr align="left">
          <td width="15%" class="block_left">会员群组代号</td>
          <td width="55%" class="block_right"><input type="text" name="mg_type" maxlength="30" size="70" style="width:370px;" value="member" class="input"></td>
          <td width="30%" class="block_right"><span id="mg_type_return"><span class="prompt_primal">会员群组代号</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">会员群组名称</td>
          <td class="block_right"><input type="text" name="mg_name" maxlength="30" size="70" style="width:370px;" value="" class="input"></td>
          <td class="block_right"><span id="mg_name_return"><span class="prompt_primal">会员群组名称</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">简介</td>
          <td class="block_right"><textarea name="mg_brief" rows="6" cols="70" style="width:370px;" class="textarea"></textarea></td>
          <td class="block_right"><span id="mg_brief_return"><span class="prompt_primal">对此会员群组的简介</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">图标</td>
          <td class="block_right"><input type="text" name="mg_icon" maxlength="30" size="70" style="width:370px;" value="" class="input"></td>
          <td class="block_right"><span id="mg_icon_return"><span class="prompt_primal">会员群组的图标</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">管理员权限</td>
          <td class="block_right">
            <select name="mg_ag_id" class="select" size="1">
            <option value="0" selected="selected">= 无管理权限 =</option>
            {foreach name=admin_group_list from=$admin_group_list item=admin_group_list}
              <option value="{$admin_group_list.ag_id}">{$admin_group_list.ag_name}</option>
            {/foreach}
            </select>
            </td>
          <td class="block_right"><span id="mg_ag_id_return"><span class="prompt_primal">此会员分组的管理员权限</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">开始会员积分</td>
          <td class="block_right"><input type="text" name="mg_point_begin" maxlength="11" size="70" style="width:370px;" value="0" class="input"></td>
          <td class="block_right"><span id="mg_point_begin_return"><span class="prompt_primal">开始会员积分,留空为不限制</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">结束会员积分</td>
          <td class="block_right"><input type="text" name="mg_point_end" maxlength="11" size="70" style="width:370px;" value="0" class="input"></td>
          <td class="block_right"><span id="mg_point_end_return"><span class="prompt_primal">结束会员积分,留空为不限制</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">排序</td>
          <td class="block_right"><input type="text" name="mg_rank" maxlength="11" size="70" style="width:370px;" value="0" class="input"></td>
          <td class="block_right"><span id="mg_rank_return"><span class="prompt_primal">排序</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">状态</td>
          <td class="block_right">
            <input type="radio" name="mg_if_enable" value="1" checked class="radio_y">&nbsp;开启
            <input type="radio" name="mg_if_enable" value="2" class="radio_n">&nbsp;关闭
            </td>
          <td class="block_right"><span id="mg_if_enable_return"><span class="prompt_primal">是否开启此会员群组</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left" valign="top">基本权限</td>
          <td colspan="2" class="block_right">
            <table width="100%" border="0" cellpadding="1" cellspacing="0">
              {foreach name=list_privilege_member from=$list_privilege_member key=key item=item}
              {if $key == "if_editpost_time" || $key == "if_delpost_time"}
              <tr bgcolor="#F8FAFE" align="left">
                <td width="40%" nowrap>{$item}</td>
                <td width="60%" nowrap>
                  <input type="text" id="mg_privilege[{$key}]" name="mg_privilege[{$key}]" size="12" style="width:80px;" value="0" class="input">&nbsp;秒,0为不限
                </td>
              </tr>
              {else}
              <tr bgcolor="#F8FAFE" align="left">
                <td width="40%" nowrap>{$item}</td>
                <td width="60%" nowrap>
                  <input type="radio" id="mg_privilege[{$key}]" name="mg_privilege[{$key}]" value="1" checked class="radio_y">&nbsp;是
                  <input type="radio" id="mg_privilege[{$key}]" name="mg_privilege[{$key}]" value="2" class="radio_n">&nbsp;否
                </td>
              </tr>
              {/if}
              {/foreach}
            </table>
          </td>
        </tr>
        <tr align="left">
          <td class="block_left" valign="top">文件权限</td>
          <td colspan="2" class="block_right">
            <table width="100%" border="0" cellpadding="1" cellspacing="0">
              {foreach name=list_fileallow_member from=$list_fileallow_member key=key item=item}
              <tr bgcolor="#F8FAFE" align="left">
                <td width="40%" nowrap>{$item}<span class="salient">({$key}.htm)</span></td>
                <td width="60%" nowrap>
                  <input type="radio" id="mg_fileallow[{$key}]" name="mg_fileallow[{$key}]" value="1" class="radio_y">&nbsp;允许
                  <input type="radio" id="mg_fileallow[{$key}]" name="mg_fileallow[{$key}]" value="2" checked class="radio_n">&nbsp;不允许
                </td>
              </tr>
              {/foreach}
            </table>
          </td>
        </tr>
        <tr>
          <td colspan="3" align="center" class="block_footer">
          <input type="button" id="member_group_submit" name="member_group_submit" value="添加" class="button"
            onclick="xajax.$('member_group_submit').disabled=true;
                     xajax.$('member_group_submit').value='请等待...';
                     xajax_submit_form('add',xajax.getFormValues('member_group_add'),'member_group_submit');">
          </td>
        </tr>
      </table>
      </form>
      </div>
      {elseif $get.ope == "amend"}
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
        <tr>
          <td align="left" nowrap>&nbsp;
            <a href="{$control_admin}" target="_self" class="current_place">管理首页</a>
            &raquo; <a href="{$control_admin}?act=member_group" target="_self" class="current_place">会员群组设定</a>
            &raquo; <a href="{$control_admin}?act=member_group&ope=amend$mid={$get.mid}&pag={$get.pag}" target="_self" class="current_place">编辑会员群组</a>
          </td>
          <td align="right" nowrap>
            [
            <a href="{$control_admin}?act=member_group&pag={$get.pag}" target="_self" class="current_place">会员群组列表</a>
            <a href="{$control_admin}?act=member_group&ope=add&pag={$get.pag}" target="_self" class="current_place">添加会员群组</a>
            ]
          </td>
        </tr>
      </table>
      </div>

      <div class="space"></div>
      <div class="right_table">
      <form id="member_group_amend" name="member_group_amend" method="post" action="javascript:void(null);" enctype="multipart/form-data">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td colspan="3">编辑会员群组</td>
        </tr>
        <tr align="left">
          <td width="15%" class="block_left">ID</td>
          <td width="55%" class="block_right">{$member_group_detail.mg_id}</td>
          <td width="30%" class="block_right"></td>
        </tr>
        <tr align="left">
          <td class="block_left">会员群组代号</td>
          <td class="block_right"><input type="text" name="mg_type" maxlength="30" size="70" style="width:370px;" value="{$member_group_detail.mg_type}" class="input"></td>
          <td class="block_right"><span id="mg_type_return"><span class="prompt_primal">会员群组代号</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">会员群组名称</td>
          <td class="block_right"><input type="text" name="mg_name" maxlength="30" size="70" style="width:370px;" value="{$member_group_detail.mg_name}" class="input"></td>
          <td class="block_right"><span id="mg_name_return"><span class="prompt_primal">会员群组名称</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">简介</td>
          <td class="block_right"><textarea name="mg_brief" rows="6" cols="70" style="width:370px;" class="textarea">{$member_group_detail.mg_brief|str_entag}</textarea></td>
          <td class="block_right"><span id="mg_brief_return"><span class="prompt_primal">对此会员群组的简介</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">图标</td>
          <td class="block_right"><input type="text" name="mg_icon" maxlength="30" size="70" style="width:370px;" value="{$member_group_detail.mg_icon}" class="input"></td>
          <td class="block_right"><span id="mg_icon_return"><span class="prompt_primal">会员群组的图标</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">管理员权限</td>
          <td class="block_right">
            <select name="mg_ag_id" class="select" size="1">
            <option value="0">= 无管理权限 =</option>
            {foreach name=admin_group_list from=$admin_group_list item=admin_group_list}
              {if $admin_group_list.ag_id == $member_group_detail.mg_ag_id}
              <option value="{$admin_group_list.ag_id}" selected="selected">{$admin_group_list.ag_name}</option>
              {else}
              <option value="{$admin_group_list.ag_id}">{$admin_group_list.ag_name}</option>
              {/if}
            {/foreach}
            </select>
            </td>
          <td class="block_right"><span id="mg_ag_id_return"><span class="prompt_primal">此会员分组的管理员权限</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">开始会员积分</td>
          <td class="block_right"><input type="text" name="mg_point_begin" maxlength="11" size="70" style="width:370px;" value="{$member_group_detail.mg_point_begin}" class="input"></td>
          <td class="block_right"><span id="mg_point_begin_return"><span class="prompt_primal">开始会员积分,留空为不限制</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">结束会员积分</td>
          <td class="block_right"><input type="text" name="mg_point_end" maxlength="11" size="70" style="width:370px;" value="{$member_group_detail.mg_point_end}" class="input"></td>
          <td class="block_right"><span id="mg_point_end_return"><span class="prompt_primal">结束会员积分,留空为不限制</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">排序</td>
          <td class="block_right"><input type="text" name="mg_rank" maxlength="11" size="70" style="width:370px;" value="{$member_group_detail.mg_rank}" class="input"></td>
          <td class="block_right"><span id="mg_rank_return"><span class="prompt_primal">排序</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">状态</td>
          <td class="block_right">
            <input type="radio" name="mg_if_enable" value="1" {if $member_group_detail.mg_if_enable == "1"}checked{/if} class="radio_y">&nbsp;开启
            <input type="radio" name="mg_if_enable" value="2" {if $member_group_detail.mg_if_enable != "1"}checked{/if} class="radio_n">&nbsp;关闭
            </td>
          <td class="block_right"><span id="mg_if_enable_return"><span class="prompt_primal">是否开启此会员群组</span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left" valign="top">基本权限</td>
          <td colspan="2" class="block_right">
            <table width="100%" border="0" cellpadding="1" cellspacing="0">
              {foreach name=list_privilege_member from=$list_privilege_member key=key item=item}
              {if $key == "if_editpost_time" || $key == "if_delpost_time"}
              <tr bgcolor="#F8FAFE" align="left">
                <td width="40%" nowrap>{$item}</td>
                <td width="60%" nowrap>
                  <input type="text" id="mg_privilege[{$key}]" name="mg_privilege[{$key}]" size="12" style="width:80px;" value="{$member_group_detail.mg_privilege.$key}" class="input">&nbsp;秒,0为不限
                </td>
              </tr>
              {else}
              <tr bgcolor="#F8FAFE" align="left">
                <td width="40%" nowrap>{$item}</td>
                <td width="60%" nowrap>
                  <input type="radio" id="mg_privilege[{$key}]" name="mg_privilege[{$key}]" value="1" {if $member_group_detail.mg_privilege.$key == "1"}checked{/if} class="radio_y">&nbsp;是
                  <input type="radio" id="mg_privilege[{$key}]" name="mg_privilege[{$key}]" value="2" {if $member_group_detail.mg_privilege.$key != "1"}checked{/if} class="radio_n">&nbsp;否
                </td>
              </tr>
              {/if}
              {/foreach}
            </table>
          </td>
        </tr>
        <tr align="left">
          <td class="block_left" valign="top">文件权限</td>
          <td colspan="2" class="block_right">
            <table width="100%" border="0" cellpadding="1" cellspacing="0">
              {foreach name=list_fileallow_member from=$list_fileallow_member key=key item=item}
              <tr bgcolor="#F8FAFE" align="left">
                <td width="40%" nowrap>{$item}<span class="salient">({$key}.htm)</span></td>
                <td width="60%" nowrap>
                  <input type="radio" id="mg_fileallow[{$key}]" name="mg_fileallow[{$key}]" value="1" {if $member_group_detail.mg_fileallow.$key == "1"}checked{/if} class="radio_y">&nbsp;允许
                  <input type="radio" id="mg_fileallow[{$key}]" name="mg_fileallow[{$key}]" value="2" {if $member_group_detail.mg_fileallow.$key != "1"}checked{/if} class="radio_n">&nbsp;不允许
                </td>
              </tr>
              {/foreach}
            </table>
          </td>
        </tr>
        <tr>
          <td colspan="3" align="center" class="block_footer">
          <input type="button" id="member_group_submit" name="member_group_submit" value="编辑" class="button"
            onclick="xajax.$('member_group_submit').disabled=true;
                     xajax.$('member_group_submit').value='请等待...';
                     xajax_submit_form('amend',xajax.getFormValues('member_group_amend'),'member_group_submit');">
          </td>
        </tr>
      </table>
      </form>
      </div>
      {else}
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
        <tr>
          <td align="left" nowrap>&nbsp;
            <a href="{$control_admin}" target="_self" class="current_place">管理首页</a>
            &raquo; <a href="{$control_admin}?act=member_group" target="_self" class="current_place">会员群组设定</a>
          </td>
          <td align="right" nowrap>
            [
            <a href="{$control_admin}?act=member_group&ope=add&pag={$get.pag}" target="_self" class="current_place">添加会员群组</a>
            ]
          </td>
        </tr>
      </table>
      </div>

      <div class="space"></div>
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td colspan="9">会员群组列表</td>
        </tr>
        <tr class="block_title">
          <td width="5%">ID</td>
          <td width="20%" align="left">会员群组名称</td>
          <td width="20%" align="left">会员群组代号</td>
          <td width="15%" align="left">管理员权限</td>
          <td width="10%">积分开始</td>
          <td width="10%">积分结束</td>
          <td width="5%">排序</td>
          <td width="5%">状态</td>
          <td width="10%">操作</td>
        </tr>
        {foreach name=member_group_list from=$member_group_list key=key item=item}
        <tr align="center" class="block_list" onmouseover="this.className='block_list_over'" onmouseout="this.className='block_list'">
          <td nowrap>{$item.mg_id}</td>
          <td align="left"><span title="{$item.mg_brief|str_entag:'space,br'}">{$item.mg_name|str_entag:'space,br'}</span></td>
          <td align="left" nowrap>{$item.mg_type}</td>
          <td align="left" nowrap><a href="{$control_admin}?act=admin_group&ope=amend&ag_id={$item.ag_id}" target="_self">{$item.ag_name}</a></td>
          <td align="right" nowrap>{$item.mg_point_begin}</td>
          <td align="right" nowrap>{$item.mg_point_end}</td>
          <td nowrap>{$item.mg_rank}</td>
          <td nowrap>
            {if $item.mg_if_enable == "1"}
              <span style="color:#00AA00;" title="当前状态为开启!">开</span>
              <a href="{$control_admin}?act=member_group&ope=if_enable&mg_id={$item.mg_id}&if_enable=2&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将状态更改为关闭!">关</span></a>
            {else}
              <a href="{$control_admin}?act=member_group&ope=if_enable&mg_id={$item.mg_id}&if_enable=1&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将状态更改为开启!">开</span></a>
              <span style="color:#EA7408;" title="当前状态为关闭!">关</span>
            {/if}
          </td>
          <td nowrap>
            <a href="{$control_admin}?act=member_group&ope=amend&mg_id={$item.mg_id}&pag={$get.pag}" target="_self"><img src="{$dir_images_admin}/icon_edit.gif" border="0" alt="改" title="修改" /></a>
            <a href="{$control_admin}?act=member_group&ope=del&mg_id={$item.mg_id}&pag={$get.pag}" target="_self" onClick="return confirm('真的要删除记录?')"><img src="{$dir_images_admin}/icon_delete.gif" border="0" alt="删" title="删除" /></a>
          </td>
        </tr>
        {/foreach}
      </table>
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center">
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right">
            <span class="pagination_post_list">
              <span class="pagelink_side" title="Total record{$pagination.record_total}">{$pagination.record_total}</span>
              <span class="pagelink_side" title="Current page{$pagination.page_current}/Page{$pagination.page_total}"><font color="#EA7408">{$pagination.page_current}</font>/{$pagination.page_total}</span>
              {if $pagination.page_listbegin != ""}<span class="pagelink_side" title="Go to first page"><a href="{$pagination.url|print_format:$pagination.page_listbegin}" target="_self" class="pagehref">&laquo;</a></span>{/if}
              {if $pagination.page_listbegin_more != ""}<span class="pagelink_side" title="Jump {$pagination.page_listnum/2|@floor} page"><a href="{$pagination.url|print_format:$pagination.page_listbegin_more}" target="_self" class="pagehref">...</a></span>{/if}
              {if $pagination.page_previous != ""}<span class="pagelink_side" title="Previous page"><a href="{$pagination.url|print_format:$pagination.page_previous}" target="_self" class="pagehref">&#8249;</a></span>{/if}
              {foreach name=page_list from=$pagination.page_list item=page_list}
                {if $page_list.if_current == "1"}
                  <span class="pagelink_current" title="Current page{$page_list.page}"><font color="#EA7408">{$page_list.page}</font></span>
                {else}
                  <span class="pagelink" title="{$page_list.page}"><a href="{$pagination.url|print_format:$page_list.page}" target="_self" class="pagehref">{$page_list.page}</a></span>
                {/if}
              {/foreach}
              {if $pagination.page_next != ""}<span class="pagelink_side" title="Next page"><a href="{$pagination.url|print_format:$pagination.page_next}" target="_self" class="pagehref">&#8250;</a></span>{/if}
              {if $pagination.page_listend_more != ""}<span class="pagelink_side" title="Jump {$pagination.page_listnum/2|@floor} page"><a href="{$pagination.url|print_format:$pagination.page_listend_more}" target="_self" class="pagehref">...</a></span>{/if}
              {if $pagination.page_listend != ""}<span class="pagelink_side" title="Go to last page"><a href="{$pagination.url|print_format:$pagination.page_listend}" target="_self" class="pagehref">&raquo;</a></span>{/if}
              <select onchange="self.location.href=this.options[this.selectedIndex].value" class="select">
              {if $pagination.page_selectbegin != ""}<option value="{$pagination.url|print_format:$pagination.page_selectbegin}">{$pagination.page_selectbegin}</option>{/if}
              {if $pagination.page_selectbegin_more != ""}<option value="{$pagination.url|print_format:$pagination.page_selectbegin_more}">...</option>{/if}
              {foreach name=page_select from=$pagination.page_select item=page_select}
                {if $page_select.if_current == "1"}
                  <option value="{$pagination.url|print_format:$page_select.page}" selected="selected">{$page_select.page}</option>
                {else}
                  <option value="{$pagination.url|print_format:$page_select.page}">{$page_select.page}</option>
                {/if}
              {/foreach}
              {if $pagination.page_selectend_more != ""}<option value="{$pagination.url|print_format:$pagination.page_selectend_more}">...</option>{/if}
              {if $pagination.page_selectend != ""}<option value="{$pagination.url|print_format:$pagination.page_selectend}">{$pagination.page_selectend}</option>{/if}
              </select>
            </span>
          </td>
        </tr>
      </table>
      </div>
      {/if}

    </td>
  </tr>
</table>
{include file="pub_footer.htm"}